package com.project.system.user.controller;


import com.project.common.util.Result;
import com.project.system.user.entity.UserEntity;
import com.project.system.user.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 商铺员工控制层
 *
 * @author yanhaizhen
 * @since 2022-02-28 13:37:44
 */
@Api(tags="商铺员工控制层")
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {

    @Resource
    private IUserService userService;


    @ApiOperation(value="根据用户id查询用户信息")
    @GetMapping(value = "/getById")
    public Result getById(@RequestParam(name="id",required=true) Integer id){
        log.info("根据用户id查询用户信息 ：{}", id);
        UserEntity user = userService.getById(id);
        return Result.OK(user);
    }



}

